package com.example.support.oss;

import com.example.support.spring.SpringContextHolder;

import org.apache.commons.lang3.StringUtils;

@Deprecated
public class UploadOssUtils {

	@Deprecated
	public static String getImageWebUrl(String key) {
		if (StringUtils.isEmpty(key)) {
			return "";
		}
		if (key.startsWith("http:")) {
			return key.replaceAll("http:", "https:");
		}
		if (key.startsWith("https")) {
			return key;
		}
		AliOssClient aliOssClient = SpringContextHolder.getContext().getBean(AliOssClient.class);
		String url = aliOssClient.getImageWebUrl(key);
		return url.replaceAll("http:", "https:");
	}

}
